﻿namespace System.ServiceModel.DomainServices.Client
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;

    public class SubmitCompletedResult
    {
        private EntityChangeSet _changeSet;
        private ReadOnlyCollection<ChangeSetEntry> _operationResults;

        public SubmitCompletedResult(EntityChangeSet changeSet, IEnumerable<ChangeSetEntry> operationResults)
        {
            if (changeSet == null)
            {
                throw new ArgumentNullException("changeSet");
            }
            if (operationResults == null)
            {
                throw new ArgumentNullException("operationResults");
            }
            this._changeSet = changeSet;
            this._operationResults = operationResults.ToList<ChangeSetEntry>().AsReadOnly();
        }

        public EntityChangeSet ChangeSet
        {
            get
            {
                return this._changeSet;
            }
        }

        public IEnumerable<ChangeSetEntry> Results
        {
            get
            {
                return this._operationResults;
            }
        }
    }
}

